package com.hongning.railway.ui.main.mine.partymember.itemviewmodel;

import android.databinding.ObservableArrayList;
import android.databinding.ObservableField;
import android.databinding.ObservableList;
import android.support.annotation.NonNull;

import com.hongning.railway.BR;
import com.hongning.railway.R;
import com.hongning.railway.entity.reqbean.QuestionResultBean;
import com.hongning.railway.entity.reqbean.QuestionResultListBean;
import com.hongning.railway.ui.main.mine.partymember.CheckReultFragmentViewModel;

import me.goldze.mvvmhabit.base.ItemViewModel;
import me.tatarka.bindingcollectionadapter2.ItemBinding;

public class CheckResultItemViewModel extends ItemViewModel<CheckReultFragmentViewModel> {
    public ItemBinding<CheckResultStringItemViewModel> itemBinding = ItemBinding.of(BR.viewModel, R.layout.item_checkstringresult);
    public ObservableList<CheckResultStringItemViewModel> viewlist = new ObservableArrayList<>();
    public ObservableField<QuestionResultListBean.SelectResultBean> selectResultBeanObservableField = new ObservableField<>();;//第一级列表数据
    public CheckResultItemViewModel(@NonNull CheckReultFragmentViewModel viewModel,QuestionResultListBean.SelectResultBean selectResultBean) {
        super(viewModel);
        selectResultBeanObservableField.set(selectResultBean);
        setdata(selectResultBean);
    }
    public void setdata(QuestionResultListBean.SelectResultBean selectResultBean){

        viewlist.add(new CheckResultStringItemViewModel(viewModel,"自我评价："+selectResultBean.getSelfEvaluationIntegral()+"分"));
        viewlist.add(new CheckResultStringItemViewModel(viewModel,"党员评价："+selectResultBean.getMutualEvaluationIntegral()+"分"));
        viewlist.add(new CheckResultStringItemViewModel(viewModel,"支部评价："+selectResultBean.getOrganizationEvaluationIntegral()+"分"));
        viewlist.add(new CheckResultStringItemViewModel(viewModel,"学习与考试："+selectResultBean.getStudyandexamIntegral()+"分"));
        viewlist.add(new CheckResultStringItemViewModel(viewModel,"组织生活："+selectResultBean.getOrganizationalLifeIntegral()+"分"));
        viewlist.add(new CheckResultStringItemViewModel(viewModel,"加分项："+selectResultBean.getBonus()+"分"));
        viewlist.add(new CheckResultStringItemViewModel(viewModel,"综合评价："+selectResultBean.getGrade()+"分"));
    }
}
